package com.java.exer_3;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

/**
 * @author shkstart
 * @create 2021-01-07 12:18
 */
public class DateTimeExer_1 {
    /*
     * 三天打鱼两天晒网   1990-01-01
     *
     * */

    public static void main(String[] args) throws ParseException {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入你要查询的日期");
        String s1 = sc.next();
        show(s1);
    }

    public static void show(String str) throws ParseException {
        String s1 = "1990-01-01";
        SimpleDateFormat s2 = new SimpleDateFormat("yyyy-MM-dd");
        Date d1 = s2.parse(s1);
        Date d2 = s2.parse(str);
        Long time1 = d1.getTime();
        Long time2 = d2.getTime();
        System.out.println(time1);
        System.out.println(time2);

        Long time3 = time2 - time1;
        System.out.println(time3);

        int day = (int) (time3 % (86400000));

        if (day % 5 == 1 | day % 5 == 2 | day % 5 == 3) {
            System.out.println(str + "他在打鱼");
        } else {
            System.out.println(str + "他在晒网");
        }


    }
}
